home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / VISUALBA / VSVBX.ZIP / FPROP.FRM < prev    next >
Text File  |  1994-03-14  |  4KB  |  128 lines

  1. VERSION 2.00
  2. Begin Form fProp 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Proportional Resizing : Resize the form"
  5.    ClientHeight    =   4320
  6.    ClientLeft      =   570
  7.    ClientTop       =   1590
  8.    ClientWidth     =   6000
  9.    Height          =   4785
  10.    Left            =   480
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4320
  13.    ScaleWidth      =   6000
  14.    Top             =   1215
  15.    Width           =   6180
  16.    Begin VideoSoftElastic VSElastic1 
  17.       Align           =   5  'Fill Container
  18.       AutoSizeChildren=   7  'Proportional
  19.       BackColor       =   &H00C0C0C0&
  20.       BevelInner      =   1  'Raised
  21.       BevelInnerWidth =   0
  22.       BevelOuter      =   1  'Raised
  23.       BevelOuterWidth =   1
  24.       Height          =   4320
  25.       Left            =   0
  26.       TabIndex        =   0
  27.       Top             =   0
  28.       Width           =   6000
  29.       Begin VideoSoftElastic VSElastic2 
  30.          AutoSizeChildren=   1  'Even Horizontal
  31.          BackColor       =   &H00C0C0C0&
  32.          BevelInner      =   0  'None
  33.          BevelInnerWidth =   3
  34.          BevelOuter      =   0  'None
  35.          BevelOuterWidth =   0
  36.          BorderWidth     =   0
  37.          Height          =   1500
  38.          Left            =   300
  39.          TabIndex        =   4
  40.          Top             =   570
  41.          Width           =   1395
  42.          Begin Image Image1 
  43.             Height          =   1500
  44.             Left            =   0
  45.             Picture         =   FPROP.FRX:0000
  46.             Stretch         =   -1  'True
  47.             Top             =   0
  48.             Width           =   1395
  49.          End
  50.       End
  51.       Begin CheckBox Check1 
  52.          BackColor       =   &H00C0C0C0&
  53.          Caption         =   "Lock Font Size"
  54.          FontBold        =   -1  'True
  55.          FontItalic      =   0   'False
  56.          FontName        =   "Arial"
  57.          FontSize        =   12
  58.          FontStrikethru  =   0   'False
  59.          FontUnderline   =   0   'False
  60.          Height          =   765
  61.          Left            =   2715
  62.          TabIndex        =   3
  63.          Top             =   3330
  64.          Width           =   3210
  65.       End
  66.       Begin CommandButton Command1 
  67.          BackColor       =   &H00C0C0C0&
  68.          Caption         =   "&Help"
  69.          FontBold        =   -1  'True
  70.          FontItalic      =   0   'False
  71.          FontName        =   "Arial"
  72.          FontSize        =   9.75
  73.          FontStrikethru  =   0   'False
  74.          FontUnderline   =   0   'False
  75.          Height          =   720
  76.          Left            =   255
  77.          TabIndex        =   2
  78.          Top             =   3285
  79.          Width           =   2340
  80.       End
  81.       Begin TextBox Text1 
  82.          BackColor       =   &H00FFFFFF&
  83.          FontBold        =   -1  'True
  84.          FontItalic      =   0   'False
  85.          FontName        =   "Arial"
  86.          FontSize        =   13.5
  87.          FontStrikethru  =   0   'False
  88.          FontUnderline   =   0   'False
  89.          ForeColor       =   &H00FF0000&
  90.          Height          =   2220
  91.          Left            =   2190
  92.          MultiLine       =   -1  'True
  93.          ScrollBars      =   2  'Vertical
  94.          TabIndex        =   1
  95.          Text            =   "Proportional Resizing locks the controls in place at design time"
  96.          Top             =   525
  97.          Width           =   3375
  98.       End
  99.    End
  100. End
  101. Option Explicit
  102.  
  103. Dim oh     'original height
  104.  
  105. Sub Command1_Click ()
  106.   MsgBox "This is done with only one elastic that fills the container and its AutoSizeChildren property set to proportional"
  107. End Sub
  108.  
  109. Sub Form_Load ()
  110.   oh = vselastic1.Height
  111. End Sub
  112.  
  113. Sub VSElastic1_ResizeChildren ()
  114.   'Code to Change fonts when form is resized
  115.   Dim I%
  116.   On Error Resume Next
  117.  
  118.   If check1.Value Then Exit Sub
  119.  
  120.   For I = 0 To Controls.Count - 1
  121.     Controls(I).FontSize = Controls(I).FontSize * (vselastic1.Height / oh)
  122.     Controls(I).FontName = "Arial"
  123.   Next I
  124.   oh = vselastic1.Height
  125.  
  126. End Sub
  127.  
  128.